package game.gui;

import java.util.ResourceBundle;

import javax.swing.*;

/**
 * @author Aqilah
 * Class AboutDialog shows a dialog about the game
 */
public class AboutDialog extends JDialog{
	
	/** Constructor */
	public AboutDialog(JFrame parent){
		super(parent, true);
		createGUI();
		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
	}
	
	/** Create the GUI for the dialog */
	public void createGUI(){		
		setTitle("About");
		String about = "<html>The player has to choose a pair of blocks and if the pair he/she chooses is identical he/she will gain points and the blocks will be removed from the matrix. On the other hand if the player chooses a pair that is different, the pair is going to be turned to the blank size again and he will lose points.<br/>The maximum size of the board is: 6x6<br/>The minimum size of the board is 2x2<br/>A pair will be close to each other based on the difficulty.</html>";
		JLabel lblAbout = new JLabel(about);
		add(lblAbout);
		setBounds(100, 100, 350, 220);
		
		// update labels
		ResourceBundle rb = ResourceBundle.getBundle("languages.MessagesBundle", getParent().getLocale());
		lblAbout.setText(rb.getString("aboutcontent"));
		setTitle(rb.getString("about"));
	}

}
